/*
 *
 */
package org.jiscinvolve.astrodabis.barberry.common.core;

import org.jiscinvolve.astrodabis.barberry.common.data.TapColumn;

/**
 *
 */
public interface Account
extends Identified, Tracked 
    {

    public static final String NAME_CHARSET = "a-z0-9.-" ;
    public static final String NAME_INCLUDE = "["  + NAME_CHARSET + "]+" ;
    public static final String NAME_EXCLUDE = "[^" + NAME_CHARSET + "]+" ;
    public static final String NAME_REPLACE = "-" ;
    public static final String NAME_EXPLAIN = "Account names may only contain lowercase alphanumeric characters (a-z and 0-9), dot '.' or dash '-'" ;

    public interface Factory
        {

        public String clean(String string);

        public Identifier ident(String ident);

        public Account create(String name, String pass);
        public Account createQuick(String name, String pass);

        public Iterable<Account> select();

        public Account select(Identifier ident);

        public Account select(String name);

        }

    public String name();

    public void pass(String pass);

    public boolean login(String pass);

    public interface Tags
        {

        public Tag create(String name);
        public Tag createQuick(String name);

        public Tag create(String name, String text);
        public Tag createQuick(String name, String text);

        public Tag select(String name);

        public Iterable<Tag> select();

        public Iterable<Tag> recent(int limit);

        }

    public Tags tags();

    public interface Jobs
        {

        public Job create(Job.Bean bean);
        public Job createQuick(Job.Bean bean);

        public Iterable<Job> select();

        public Iterable<Job> recent(int limit);

        }

    public Jobs jobs();

    }

